package com.sos.widget.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Paint;
import android.util.AttributeSet;

import androidx.annotation.Nullable;

import com.sos.widget.R;


public class PaintTextView extends androidx.appcompat.widget.AppCompatTextView {
    public PaintTextView(Context context) {
        super(context);
    }

    public PaintTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView(attrs);
    }

    private void initView(AttributeSet attrs) {
        TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.PaintTextView);
        if(typedArray.hasValue(R.styleable.PaintTextView_m_paint)){
            int painFlags = typedArray.getInt(0, R.styleable.PaintTextView_m_paint);
            getPaint().setFlags(painFlags| Paint.ANTI_ALIAS_FLAG);// 设置中划线并加清晰

        }

    }

}
